<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>旋转</title>
</head>
<body>
    <div class="box">
        <ul class="minbox">
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
        <ul class="maxbox">
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
            <li></li>
        </ul>
    </div>
</body>
</html>
<style>
ul{
list-style: none;
}
body{
    background-color: #000;
}
.box{
    position:absolute;
    transform: translateY(-50%) translateX(-50%);
    top: 50%;
    left: 50%;
    width: 400px;
    height: 400px;
}
.box .minbox,.box .maxbox{
    position: absolute;
    margin: 0 auto;
    width: 200px;
  height: 200px;
  backface-visibility: visible;
  transform-style: preserve-3d;
  transform:rotate3d(1,1,0,20deg) rotateY(0deg);
  animation: max-rotate linear 5s infinite;
}

.minbox li,.maxbox li{
    position: absolute;
  width: 200px;
  height: 200px;
  border: none;
  line-height: 100px;
  font-family: sans-serif;
  font-size: 60px;
  color: white;
  text-align: center;
  /* opacity: 0.8; */
}
.box .maxbox,.maxbox li{
    width: 400px;
    height: 400px;
}

.box .minbox{
    top: 50%;
    left: 50%;
    transform: translateY(-50%) translateX(-50%) rotate3d(1,1,0,20deg) rotateY(0deg);
    animation: min-rotate linear 5s infinite;
}
.box .maxbox li{
opacity: 0.2;
}
 .minbox li:nth-child(1){
     transform: translateZ(100px);
     background-image: url('./img/1.jpeg');
     background-size: cover;
}
 .minbox li:nth-child(2){
    transform: rotateY(180deg) translateZ(100px);
    background-image: url('./img/2.jpeg');
    background-size: cover;
}
.minbox li:nth-child(3){
    transform: rotateY(90deg) translateZ(100px);
    background-image: url('./img/3.jpeg');
    background-size: cover;
}
.minbox li:nth-child(4){
  transform: rotateY(-90deg) translateZ(100px);
  background-image: url('./img/4.jpeg');
  background-size: cover;
}
.minbox li:nth-child(5){
  transform: rotateX(90deg) translateZ(100px);
  background-image: url('./img/5.jpeg');
  background-size: cover;
}
.minbox li:nth-child(6){
  transform: rotateX(-90deg) translateZ(100px);
  background-image: url('./img/6.jpeg');
  background-size: cover;
} 

.maxbox li:nth-child(1){
    animation: li1 5s;
    animation-fill-mode: forwards;
     transform: translateZ(200px);
     background-image: url('./img/1.jpeg');
     background-size: cover;
}
 .maxbox li:nth-child(2){
    animation: li2 5s;
    animation-fill-mode: forwards;
    transform: rotateY(180deg) translateZ(200px);
    background-image: url('./img/2.jpeg');
    background-size: cover;
}
.maxbox li:nth-child(3){
    animation: li3 5s;
    animation-fill-mode: forwards;
    transform: rotateY(90deg) translateZ(200px);
    background-image: url('./img/3.jpeg');
    background-size: cover;
}
.maxbox li:nth-child(4){
    animation: li4 5s;
    animation-fill-mode: forwards;
    transform: rotateY(-90deg) translateZ(200px);
  background-image: url('./img/4.jpeg');
  background-size: cover;
}
.maxbox li:nth-child(5){
    animation: li5 5s;
    animation-fill-mode: forwards;
    transform: rotateX(90deg) translateZ(200px);
  background-image: url('./img/5.jpeg');
  background-size: cover;
}
.maxbox li:nth-child(6){
    animation: li6 5s;
    animation-fill-mode: forwards;
  transform: rotateX(-90deg) translateZ(200px);
  background-image: url('./img/6.jpeg');
  background-size: cover;
} 


@keyframes min-rotate
{
0% { transform: translateY(-50%) translateX(-50%) rotate3d(1,1,0,20deg) rotateY(0deg) ;
}
100% {transform: translateY(-50%) translateX(-50%) rotate3d(1,1,0,20deg) rotateY(720deg);

}
}
@keyframes max-rotate
{
from { transform:rotate3d(1,1,0,20deg) rotateY(0deg);
}
to {
    transform: rotate3d(1,1,0,20deg) rotateY(720deg) ;
}
}

@keyframes li1 {
30% {      
    opacity: 0.2;
    transform: translateZ(200px);
}
50% 
{    
    opacity: 0.8;
    transform: translateZ(300px);
}
100% 
{ 
    opacity: 0.8;   
    transform: translateZ(300px);
}
}
@keyframes li2 {
30% {   
    opacity: 0.2;   
    transform: rotateY(180deg) translateZ(200px);
}
50% 
{    
    opacity: 0.8;  
    transform: rotateY(180deg) translateZ(300px);
}
100% 
{    
    opacity: 0.8;  
    transform: rotateY(180deg) translateZ(300px);
}
}
@keyframes li3 {
30% {  
    opacity: 0.2;      
    transform: rotateY(90deg) translateZ(200px);
}
50% 
{    
    opacity: 0.8;  
    transform: rotateY(90deg) translateZ(300px);
}
100% 
{    
    opacity: 0.8;  
    transform: rotateY(90deg) translateZ(300px);
}
}
@keyframes li4 {
30% {    
    opacity: 0.2;    
    transform: rotateY(-90deg) translateZ(200px);
}
50% 
{    
    opacity: 0.8;  
    transform: rotateY(-90deg) translateZ(300px);
}
100% 
{    
    opacity: 0.8;  
    transform: rotateY(-90deg) translateZ(300px);
}
}
@keyframes li5 {
30% {    
    opacity: 0.2;    
    transform: rotateX(90deg) translateZ(200px);
}
50% 
{    
    opacity: 0.8;  
    transform: rotateX(90deg) translateZ(300px);
}
100% 
{    
    opacity: 0.8;  
    transform: rotateX(90deg) translateZ(300px);
}
}
@keyframes li6 {
30% {      
    opacity: 0.2;  
    transform: rotateX(-90deg) translateZ(200px);
}
50% 
{    
    opacity: 0.8;  
    transform: rotateX(-90deg) translateZ(300px);
}
100% 
{    
    opacity: 0.8;  
    transform: rotateX(-90deg) translateZ(300px);
}
}
</style>